﻿using Jayden.Dll.Core.Persistence;
using Jayden.Dll.Core.Persistence.Attributes;
using Jayden.Dll.Core.Persistence.Enums;

namespace Jayden.Dll.Core.Membership
{
	[Table]
	public class Role : ObjectBase
	{
		private string m_RoleName;

		public Role(UnitOfWork uow) : base(uow, 0) { }

		[Field(PrimaryKey = true, AutoIncrement = true)]
		public long RoleId { get { return (long)ObjectId[0]; } set { ObjectId[0] = value; } }

		[Field(Unique=true)]
		public string RoleName
		{
			get { return m_RoleName; }
			set
			{
				m_RoleName = value;
				State = ObjectState.Dirty;
			}
		}

	}
}
